package com.mworld.galaxy.bull.entity.product;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
import com.mworld.galaxy.bull.entity.IdEntity;

@Entity
@Table(name = "t_product_image")
@JsonAutoDetect(getterVisibility = Visibility.PUBLIC_ONLY)
public class ProductImage extends IdEntity {
    private Product product;
    private String path;
    private long order;

    public ProductImage() {
        super();
    }
    public ProductImage(Long id) {
        super(id);
    }

    @ManyToOne
    @JoinColumn(name = "c_product_id")
    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

    @NotNull
    @Column(name = "c_path")
    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    @Column(name = "c_order")
    public long getOrder() {
        return order;
    }

    public void setOrder(long order) {
        this.order = order;
    }

}
